<template>
	<view class="sui-loading-init" v-if="visible">
		<view class="sui-loading-center"></view>
	</view>
</template>

<script>
	export default {
		name: "suLoading",
		data() {
			return {
				visible:false
			}
		},
		methods:{
			show(){
				this.visible = true
			},
			hide(){
				this.visible = false
			}
		}
	}
</script>

<style lang="scss">
	.sui-loading-init {
		min-width: 90upx;
		min-height: 90upx;
		max-width: 500upx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		z-index: 9999;
		font-size: 26upx;
		color: #fff;
		background: rgba(248, 248, 248, .9);
		border-radius: 10upx;
	}

	.sui-loading-center {
		display: inline-block;
		margin: 0 12upx;
		vertical-align: middle;
		width: 40upx;
		height: 40upx;
		background: 0 0;
		border-radius: 50%;
		border: 5upx solid;
		border-color: #e5e5e5 #e5e5e5 #e5e5e5 $maincolor;
		animation: sui-rotate 0.7s linear infinite;
	}

	.sui-loadmore-tips {
		text-align: center;
		padding: 0 20upx;
		box-sizing: border-box;
	}

	@-webkit-keyframes rotate {
		from {
			transform: rotatez(0deg);
		}

		to {
			transform: rotatez(360deg);
		}
	}
	@-webkit-keyframes sui-rotate {
		0% {
			transform: rotate(0);
		}

		100% {
			transform: rotate(360deg);
		}
	}
	@keyframes rotate {
		from {
			transform: rotatez(0deg);
		}

		to {
			transform: rotatez(360deg);
		}
	}
</style>
